﻿CREATE PROCEDURE [dbo].[yaf_user_adminsave](
                @BoardID     INT,
                @UserID      INT,
                @Name        NVARCHAR(50),
                @Email       NVARCHAR(50),
                @IsHostAdmin BIT,
                @RankID      INT)
AS
    BEGIN
        IF @IsHostAdmin <> 0
        UPDATE yaf_User
        SET    Flags = Flags | 1
        WHERE  UserID = @UserID
        ELSE
        UPDATE yaf_User
        SET    Flags = Flags & ~ 1
        WHERE  UserID = @UserID
        UPDATE yaf_User
        SET    Name = @Name,
               Email = @Email,
               RankID = @RankID
        WHERE  UserID = @UserID
        SELECT UserID = @UserID
    END


